Skip to content

Inscoper::XMLDocument

XMLDocument class represents an entire XML document. More...

#include <XMLDocument.h>

Public Functions

Name
XMLDocument()
Default constructor.
~XMLDocument()
Destructor.
void loadFile(const std::string & xmlFile)
Load from file.
bool tryLoadingFile(const std::string & xmlFile)
Try loading from file.
void saveFile(const std::string & xmlFile)
Save to file.
Inscoper::XMLNode getChild(const std::string & name)
Get child node by name.
Inscoper::XMLNode toXMLNode()
Convert to XML node.

Detailed Description

class Inscoper::XMLDocument;

XMLDocument class represents an entire XML document.

Note: This class is non-copyable and non-movable.

This class handles loading and saving of XML documents and access to the root node.

Public Functions Documentation

function XMLDocument

XMLDocument()

Default constructor.

function ~XMLDocument

~XMLDocument()

Destructor.

function loadFile

void loadFile(
    const std::string & xmlFile
)

Load from file.

Parameters:

  • xmlFile : The path to the XML file

Exceptions:

Loads the XML document from a file path.

function tryLoadingFile

bool tryLoadingFile(
    const std::string & xmlFile
)

Try loading from file.

Parameters:

  • xmlFile : The path to the XML file

Return: True if loading was successful, false otherwise

Attempts to load the XML document without throwing an exception.

function saveFile

void saveFile(
    const std::string & xmlFile
)

Save to file.

Parameters:

  • xmlFile : The path where the XML file will be saved

Exceptions:

Saves the current XML document to a file.

function getChild

Inscoper::XMLNode getChild(
    const std::string & name
)

Get child node by name.

Parameters:

  • name : The name of the child node

Return: The child XML node

Retrieves a direct child node with the name.

function toXMLNode

Inscoper::XMLNode toXMLNode()

Convert to XML node.

Return: The root XML node

Returns the root element of the document as an XML node.


Updated on 2026-04-02 at 10:55:36 +0200